<template>
  <div>
    <div class="fee-rect">
      <div class="title">{{ tableTit }}</div>
      <div class="sel-sty">
        <div :class="item.isActive ? 'sel-text' : 'text'" v-for="item in selData" :key="item.name"
          @click="selectBtn(item.name)">
          {{ item.name }}
        </div>
      </div>
      <div class="table-sty">
        <Table :columns="columns" :data="data" class="my-table"></Table>
      </div>
      <pagination-com :totalPages="allPage" :currentPage="currentPage" @specifyMet="specifyMet"></pagination-com>
    </div>
  </div>
</template>
<script>
import paginationCom from './pagination-Com.vue';

export default {
  components: { paginationCom },
  props: {
    tableTit: {
      type: String,
      default: () => {
        return ''
      }
    },
    selData: {
      type: Array,
      default: () => {
        return [];
      }
    },
    columns: {
      type: Array,
      default: () => {
        return [];
      }
    },
    data: {
      type: Array,
      default: () => {
        return [];
      }
    },
    currentPage: {
      type: Number,
      required: true
    },
    allPage: {
      type: Number,
      required: true
    },
  },
  data() {
    return {

    }
  },
  methods: {
    selectBtn(name) {
      this.$emit('changeTab', name);
    },
    specifyMet(val) {
      this.$emit('updateMet', val)
    }
  }
}
</script>
<style lang="less" scoped>
:deep(.ivu-table-overflowX::-webkit-scrollbar) {
  // -webkit-appearance: none;
  width: 10px;
  height: 10px;
}

:deep(.ivu-table-tbody) {
  tr {

    td {
      height: 60px;
      border: none;

      .ivu-table-cell {
        font-weight: 500;
        font-size: 18px;
        color: #767B93;
        line-height: 19px;
      }
    }
  }
}

:deep(.ivu-table-header) {
  margin-bottom: 24px;

  thead {
    tr {
      th {
        background: none;
        padding: 0;
        padding-bottom: 24px;
        padding-top: 6px;

        .ivu-table-cell {
          font-family: PingFang SC, PingFang SC;
          font-weight: 500;
          font-size: 18px;
          color: #333333;
          line-height: 19px;
        }
      }
    }
  }
}

:deep(.ivu-table) {
  .ivu-table-fixed-header {
    margin-bottom: 24px;

    thead {
      tr {
        th {
          background: #FFFFFF;
          padding: 0;
          padding-bottom: 24px;
          padding-top: 6px;

          .ivu-table-cell {
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            font-size: 18px;
            color: #333333;
            line-height: 19px;
          }
        }
      }
    }
  }
}

.fee-rect {
  padding: 32px 0;
  background: #FFFFFF;
  border-radius: 18px 18px 18px 18px;
  border: 1px solid #E8E8E8;
  margin-top: 38px;

  .title {
    font-family: Open Sans, Open Sans;
    font-weight: 600;
    font-size: 24px;
    color: #1E1714;
    line-height: 28px;
    margin-bottom: 27px;
    margin-left: 40px;
  }

  .sel-sty {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-left: 55px;
    margin-bottom: 39px;
    margin-top: 8px;

    .text {
      font-family: Open Sans, Open Sans;
      font-weight: 600;
      font-size: 20px;
      color: #767B93;
      line-height: 23px;
      padding: 8px 61px 8px 57px;
      cursor: pointer;
    }

    .text:hover {
      font-family: Open Sans, Open Sans;
      font-weight: 600;
      font-size: 20px;
      color: #000000;
      line-height: 23px;
      padding: 8px 61px 8px 57px;
      background: #F5F5F7;
      border-radius: 19px;
    }

    .sel-text {
      font-family: Open Sans, Open Sans;
      font-weight: 600;
      font-size: 20px;
      color: #000000;
      line-height: 23px;
      padding: 8px 61px 8px 57px;
      background: #F5F5F7;
      border-radius: 19px;
    }
  }

  .table-sty {
    margin: 0 56px;

    :deep(.ivu-table-fixed.ivu-table-fixed-shadow) {
      box-shadow: none;
    }
  }
}
</style>